<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>代约团课</title>
	<meta content="width=device-width,initial-scale=1.0,maximum-scale=1.0,minimum-scale=1.0,user-scalable=no"
		name="viewport">
	<link rel="stylesheet" href="css/weui.min.css">
	<link rel="stylesheet" href="css/jquery-weui.css">
	<link rel="stylesheet" href="css/swiper.min.css">
	<link rel="stylesheet" href="css/bosscoach.css">
	<link rel="stylesheet" href="css/membership.css">
	<link rel="stylesheet" href="css/reset.css">
	<link rel="stylesheet" href="css/bossIndex.css">
	<link rel="stylesheet" href="css/flexible.css">
	<link rel="stylesheet" href="css/vant.css">
	<script src="js/vue/vue.js"></script>
	<script src="js/vue/axios.js"></script>
	<script src="js/vue/vant.js"></script>
	<script src="js/vue/MD5.js"></script>
	<script src="js/vue/qs.js"></script>
	<script src="js/jquery-3.3.1.min.js"></script>
	<script src="js/fontsize.js"></script>
	<script src="js/comment.js"></script>
	<script src="js/glabe.js"></script>
	<script src="js/jquery.min.js"></script>
	<script src="js/flexible.js"></script>
</head>

<body>
	<div id="app">
		<div class="courseDateDiv clearfix Substitution_header">
			<p class="courseDateShow-span fl" id="courseDateShow"></p>
			<div class="courseDate-icon fr">
				<img src="images/calendar_icon.png" alt="">
				<input class="courseDate-input" id="courseDate_input" inputreadonly="true" readonly="readonly">
			</div>
		</div>
		<div class="courseDate-panel">
			<ul class="course-week clearfix">
				<li>日</li>
				<li>一</li>
				<li>二</li>
				<li>三</li>
				<li>四</li>
				<li>五</li>
				<li>六</li>
			</ul>
			<div class="swiper-container">
				<div class="swiper-wrapper" id="course_date">
				</div>
			</div>
		</div>
		<template>
			<div class="Substitution_list Substitution_course" v-for="item in dataList" :key="item.id">
				<div class="group_details group_details_state clearfix" style="padding-right: 0.5rem;">
					<div class="fl"><img :src="item.picurl" alt="" class="spinning_img"></div>
					<div class="spinning_txt fl" style="padding-top:0;width: 50%;">
						<p><span class="spinning_txx">{{item.title}}</span><span class="spinning_name" style="font-size: 0.65rem;">{{item.Sname}}</span></p>
						<p><span class="spinning_date">{{item.stime}}-{{item.etime}}</span></p>
						<p class="degree">{{item.yyNum}}/{{item.max}} <span class="many_full">预约满{{item.min}}人开课</span></p>
					</div>
					<div v-if="item.yy_state==1" class="appointment fr">
						<div  style="color: #fff;"
						 @click="selectCard(item.plan_id,item.key,item.date,item.currid)">预约</div>
					</div>
					<div v-if="item.yy_state==0" class="appointment fr" style="background-color: #fff;"><a href="#" style="color: #ddd;" >已过时</a></div>
					<div v-if="item.yy_state==2" class="appointment fr" style="background-color: #fff;"><a href="#" style="color: #ddd;" >预约人数已满</a></div>
					<div v-if="item.yy_state==3" class="appointment fr" style="background-color: #fff;"><a href="#" style="color: #ddd;" >已经预约</a></div>
					<div v-if="item.yy_state==4" class="appointment fr" style="background-color: #fff;"><a href="#" style="color: #ddd;" >已签到待评价课程 </a></div>
					<div v-if="item.yy_state==5" class="appointment fr" style="background-color: #fff;"><a href="#" style="color: #ddd;" >已违约</a></div>
				</div>
			</div>
		</template>
		<div class="technicalSupport">由馆家提供技术支持</div>
	</div>
	<script src="js/jquery-weui.js"></script>
	<script src="js/swiper.min.js"></script>
	<script>
		var app = new Vue({
			el: '#app',
			data: {
				dataList:[],
				newDate: '',
				uid:''
			},
			watch: {
				newDate(){
					console.log(this.newDate);
					if(this.newDate!=''){
						this.getList()
					}
				},
			},
			created() {
				this.uid=getUrlQueryString("uid")
				var uid = getUrlQueryString("uid")
					axios.get(`mobileapi/boss/curr.php?act=tkList&uid=${uid}`).then(res => {
					console.log(res)
					var dataList = res.data.data
					this.dataList=dataList
					console.log(dataList);
				}).catch(err => {
					vant.Toast('请求发送失败，请重试');
				})
			},
			mounted() {
				console.log(this.newDate);
			},
			methods: {
				selectCard(plan_id,key,date,currid){
					window.location.href='selectCard.html?uid='+this.uid+'&plan_id='+plan_id+'&key='+key+'&date='+date+'&currid='+currid+''
				},
				getList(){
					axios.get(`mobileapi/boss/curr.php?act=tkList&uid=${this.uid}&date=${this.newDate}`).then(res => {
						if(res.data.code == 200){
							var dataList = res.data.data
							this.dataList=dataList
						}else{
							vant.Toast(res.data.msg);
						}
					}).catch(err => {
						vant.Toast('请求发送失败，请重试');
					})
				}
			}
		})
	</script>
	<script src="js/fitnesslist.js"></script>
</body>
</html>